import React, { Component } from 'react';
import { Link } from 'react-router-dom';


const cart = require('src/static/cart.png');

class CartEmpty extends Component {

  render() {
    const userInfo = window.localStorage.getItem('userInfo');
    const { loginShowHandle } = this.props;
    return (
      <div className="cart-empty">
        <div>
          <img src={cart} alt="" />
          <div className="cart-empty-ctrl">
            <div>购物车内暂时没有商品，登录后将显示您之前加入的商品</div>
            <div>
              {
                userInfo ? '' : <button onClick={loginShowHandle}>登录</button>
              }
              <span><Link to="/">去购物 &gt; </Link></span>
            </div>
          </div>
        </div>
      </div>
    );
  }
}

export default CartEmpty;
